//
//  ESTClueOrSellTableViewController.m
//  ESTSCRMAPP
//
//  Created by 李贤立 on 2018/11/1.
//  Copyright © 2018年 Capfer. All rights reserved.
//

#import "ESTClueOrSellTableViewController.h"
#import "ESTPickerTipView.h"
#import "ESTVerticalValueView.h"
#import "TYZCustomSelectedView.h"
#import "TYZPickerTool.h"
#import "ESTClueOrSellDataCell.h"
#define ASigletonDataHeight                 80
@interface ESTClueOrSellTableViewController ()<UITableViewDelegate, UITableViewDataSource>
/**
 *  TableView
 */
@property(nonatomic, strong) TYZTableView *tableView;
/**
 *  记录滑动量
 */
@property(nonatomic, assign) CGFloat offSetY;
/**
 *  经销商名称
 */
@property(nonatomic, strong) NSArray<NSString *> *org_nameArray;
/**
 *  经销商ID
 */
@property(nonatomic, strong) NSArray<NSString *> *org_IDArray;
/**
 *  选择了第几个经销商
 */
@property(nonatomic, assign) NSInteger orgNumber;
/**
 *  日周月类型
 */
@property(nonatomic, assign) NSInteger dateType;
/**
 *  日期
 */
@property(nonatomic, copy) NSString *dateString;
/**
 *  月份日期
 */
@property(nonatomic, copy) NSString *dateString_month;
/**
 *  电销概况的文字
 */
@property(nonatomic, strong) NSArray<NSString *> *telSaleTextArray;
/**
 *  销售概况的文字
 */
@property(nonatomic, strong) NSArray<NSString *> *saleTextArray;
/**
 *  线索跟进的文字
 */
@property(nonatomic, strong) NSArray<NSString *> *clueFollowTextArray;
/**
 *  客户跟进的文字
 */
@property(nonatomic, strong) NSArray<NSString *> *cusFollowTextArray;
/**
 *  线索目标跟进的文字
 */
@property(nonatomic, strong) NSArray<NSString *> *clueTargetTextArray;
/**
 *  销售目标跟进的文字
 */
@property(nonatomic, strong) NSArray<NSString *> *saleTargetTextArray;
@end

@implementation ESTClueOrSellTableViewController
#pragma mark - 生命周期方法
- (void)viewDidLoad {
    [super viewDidLoad];
    self.dateString = [[NSDate date] formatterDate:@"yyyy-MM-dd"];
    self.dateString_month = [[NSDate date] formatterDate:@"yyyy-MM"];
    NSMutableArray *arrM1 = [NSMutableArray arrayWithCapacity:UserInfo.DLR_INFO.count];
    NSMutableArray *arrM2 = [NSMutableArray arrayWithCapacity:UserInfo.DLR_INFO.count];
    [UserInfo.DLR_INFO enumerateObjectsUsingBlock:^(ESTDLRInfo * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [arrM1 addObject:obj.ORG_NAME];
        [arrM2 addObject:obj.ORG_ID];
    }];
    self.org_nameArray = [arrM1 mutableCopy];
    self.org_IDArray = [arrM2 mutableCopy];
    [self setupTitleView];
    [self setupTableView];
}
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.tableView reloadData];
}
#pragma mark - 设置UI
- (void)setupTitleView {
    TYZView *titleView = [[TYZView alloc] init];
    [self.view addSubview:titleView];
    [titleView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(self.view);
        make.height.mas_equalTo(DE_NavigationHeight);
    }];
    titleView.backgroundColor = ThemeColor;
    TYZLabel *titleLabel = [[TYZLabel alloc] init];
    [titleView addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(titleView);
        make.bottom.equalTo(titleView).offset(-10);
    }];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = self.isSellMode ? [@"销售看板" S] : [@"线索看板" S];
    titleLabel.font = [UIFont boldSystemFontOfSize:CoreInfo.fontSize * 1.2];
    titleLabel.textColor = TYZWhiteColor;
}
- (void)setupTableView {
    [self.view addSubview:self.tableView];
    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(self.view);
        make.top.equalTo(self.view).offset(DE_NavigationHeight);
    }];
    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"ESTClueOrSellTableViewControllerCell"];
    [self setupTableViewMj_header];
}
- (void)setupTableViewMj_header {
    WEAKSELF
    self.tableView.mj_header = [MJRefreshStateHeader headerWithRefreshingBlock:^{
//        [weakSelf refreshHomeData];
        [weakSelf.tableView.mj_header endRefreshing];
    }];
    MJRefreshStateHeader *stateHeader = (MJRefreshStateHeader *)self.tableView.mj_header;
    stateHeader.textColor = TYZWhiteColor;
}
- (void)setupFirstCell:(UIView *)contentView {
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"manager_headerbg"]];
    [contentView addSubview:imageView];
    imageView.frame = contentView.bounds;
    
    ESTPickerTipView *pickerView = [[ESTPickerTipView alloc] init];
    pickerView.title = self.org_nameArray[self.orgNumber];
    pickerView.textColor = PickerTipViewTextColor_White;
    [contentView addSubview:pickerView];
    [pickerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(contentView);
        make.top.equalTo(contentView).offset(10);
    }];
    pickerView.selectedValue = @[self.org_nameArray[self.orgNumber]];
    pickerView.dataArray = self.org_nameArray;
    pickerView.titleLabel.font = TYZFont(CoreInfo.fontSize);
    WEAKSELF
    [pickerView setDidChooseNumberBlock:^(NSArray<NSNumber *> *numberArray) {
        weakSelf.orgNumber = [numberArray.lastObject integerValue];
        [weakSelf.tableView reloadData];
    }];
    
    if (self.isSellMode) {
        ESTVerticalValueView *leftView0 = [ESTVerticalValueView valueViewWithName:[@"线索" S] value:@"0"];
        [contentView addSubview:leftView0];
        [leftView0 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(contentView).offset(-kWindowWidth * 0.25);
            make.bottom.equalTo(contentView).offset(-20 - ASigletonDataHeight);
        }];
        [leftView0 setDidClickCoverBlock:^{
            
        }];
        
        ESTVerticalValueView *rightView0 = [ESTVerticalValueView valueViewWithName:[@"意向客户" S] value:@"0"];
        [contentView addSubview:rightView0];
        [rightView0 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(contentView).offset(kWindowWidth * 0.25);
            make.bottom.equalTo(contentView).offset(-20 - ASigletonDataHeight);
        }];
        [rightView0 setDidClickCoverBlock:^{
            
        }];
    }
    
    ESTVerticalValueView *leftView1 = [ESTVerticalValueView valueViewWithName:self.isSellMode ? [@"累计未交车订单" S] : [@"采集待处理" S] value:@"0"];
    [contentView addSubview:leftView1];
    [leftView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(contentView).offset(-kWindowWidth * 0.25);
        make.bottom.equalTo(contentView).offset(-20);
    }];
    [leftView1 setDidClickCoverBlock:^{

    }];

    ESTVerticalValueView *rightView1 = [ESTVerticalValueView valueViewWithName:self.isSellMode ? [@"保有客户" S] : [@"电话跟进中" S] value:@"0"];
    [contentView addSubview:rightView1];
    [rightView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(contentView).offset(kWindowWidth * 0.25);
        make.bottom.equalTo(contentView).offset(-20);
    }];
    [rightView1 setDidClickCoverBlock:^{

    }];
}
- (void)setupSecondCell:(UIView *)contentView {
    TYZCustomSelectedView *selectedView = [[TYZCustomSelectedView alloc] init];
    [contentView addSubview:selectedView];
    [selectedView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(contentView);
        make.left.equalTo(contentView).offset(10);
        make.height.mas_equalTo(30);
        make.width.mas_equalTo(150);
    }];
    selectedView.selectedNumber = self.dateType;
    selectedView.titleArray = @[[@"日报" S], [@"周报" S], [@"月报" S]];
    WEAKSELF
    [selectedView setDidSelectedBlock:^(NSInteger integer) {
        weakSelf.dateType = integer;
        [weakSelf.tableView reloadData];
    }];
    
    TYZButton *rightButton = [[TYZButton alloc] init];
    [contentView addSubview:rightButton];
    [rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(contentView);
        make.right.equalTo(contentView).offset(-10);
    }];
    [rightButton setImage:[UIImage imageNamed:@"date_icon"] forState:UIControlStateNormal];
    NSString *title = self.dateType == 2 ? self.dateString_month : self.dateString;
    [rightButton setTitleColor:TYZLightMColor forState:UIControlStateNormal];
    [rightButton setTitle:[NSString stringWithFormat:@"  %@", title] forState:UIControlStateNormal];
    [rightButton addTarget:self action:@selector(didClickDateButton) forControlEvents:UIControlEventTouchUpInside];
    rightButton.titleLabel.font = TYZFont(CoreInfo.fontSize);
    [contentView addLine];
}
#pragma mark - actions
- (void)didClickDateButton {
    TYZDatePickerMode dateMode;
    NSString *title;
    switch (self.dateType) {
        case 1:
            dateMode = DatePickerMode_Date;
            title = [@"周所含有的任意日期" S];
            break;
        case 2:
            dateMode = DatePickerMode_YearMonth;
            title = [@"请选择月份" S];
            break;
        default:
            dateMode = DatePickerMode_Date;
            title = [@"请选择日期" S];
            break;
    }
    WEAKSELF
    [TYZPickerTool showDatePickerWithTitle:title dateString:self.dateString datePickerMode:dateMode complement:^(NSString *dateString) {
        if (weakSelf.dateType == 2) {
            weakSelf.dateString_month = dateString;
        } else {
            weakSelf.dateString = dateString;
        }
        [weakSelf.tableView reloadData];
    }];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 5;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        if (self.isSellMode) {
            return ASigletonDataHeight * 2 + 60;
        }
        return ASigletonDataHeight + 60;
    }
    if (indexPath.section == 1) {
        return 60;
    }
    if (indexPath.section == 2) {
        return ClueOrSellDataCellTopHeight + ASigletonDataHeight * 2 + 20;
    }
    if (indexPath.section == 3) {
        if (self.isSellMode) {
            return ClueOrSellDataCellTopHeight + ASigletonDataHeight * 2 + 20;
        }
        return ClueOrSellDataCellTopHeight + ASigletonDataHeight + 20;
    }
    if (indexPath.section == 4) {
        if (self.isSellMode) {
            return ClueOrSellDataCellTopHeight + ASigletonDataHeight * 2 + 20;
        }
        return ClueOrSellDataCellTopHeight + ASigletonDataHeight + 20;
    }
    return 44;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section < 2) {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ESTClueOrSellTableViewControllerCell" forIndexPath:indexPath];
        [cell.contentView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            [obj removeFromSuperview];
        }];
        if (indexPath.section == 0) {
            [self setupFirstCell:cell.contentView];
        } else {
            [self setupSecondCell:cell.contentView];
        }
        return cell;
    }
    ESTClueOrSellDataCell *cell = [ESTClueOrSellDataCell creatClueOrSellDataCell:tableView];
    TYZView *menuView = [[TYZView alloc] init];
    [cell.mainView addSubview:menuView];
    [menuView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(cell.mainView).offset(10);
        make.top.equalTo(cell.mainView).offset(10);
        make.right.bottom.equalTo(cell.mainView).offset(-10);
    }];
    menuView.layer.borderColor = ESTBackgroundColor.CGColor;
    menuView.layer.borderWidth = 1;
    if (indexPath.section == 2) {
        if (self.isSellMode) {
            cell.iconName = @"clueOrSell_sale_detail";
            cell.title = self.saleTextArray.lastObject;
            [self.saleTextArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                if (idx < self.saleTextArray.count - 1) {
                    CGFloat width = (kWindowWidth - 20) / 3;
                    CGFloat height = ASigletonDataHeight;
                    if (idx == 2) {
                        height *= 2;
                    }
                    ESTVerticalValueView *childView = [ESTVerticalValueView valueViewWithName:obj value:@"0" backgroundColorModel:BackgroundColor_Theme];
                    [menuView addSubview:childView];
                    childView.layer.borderColor = ESTBackgroundColor.CGColor;
                    childView.layer.borderWidth = 0.5;
                    [childView mas_makeConstraints:^(MASConstraintMaker *make) {
                        make.top.equalTo(menuView).offset(idx / 3 * ASigletonDataHeight);
                        make.width.mas_equalTo(width);
                        make.left.equalTo(menuView).offset(idx % 3 * width);
                        make.height.mas_equalTo(height);
                    }];
                    [childView setDidClickCoverBlock:^{
                        
                    }];
                }
            }];
        } else {
            cell.iconName = @"clueOrSell_tel_survey";
            cell.title = self.telSaleTextArray.lastObject;
            [self.telSaleTextArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                if (idx < self.telSaleTextArray.count - 1) {
                    CGFloat width = (kWindowWidth - 20) * 0.5;
                    CGFloat height = ASigletonDataHeight;
                    ESTVerticalValueView *childView = [ESTVerticalValueView valueViewWithName:obj value:@"0" backgroundColorModel:BackgroundColor_Theme];
                    [menuView addSubview:childView];
                    childView.layer.borderColor = ESTBackgroundColor.CGColor;
                    childView.layer.borderWidth = 0.5;
                    [childView mas_makeConstraints:^(MASConstraintMaker *make) {
                        make.top.equalTo(menuView).offset(idx / 2 * ASigletonDataHeight);
                        make.width.mas_equalTo(width);
                        make.left.equalTo(menuView).offset(idx % 2 * width);
                        make.height.mas_equalTo(height);
                    }];
                    [childView setDidClickCoverBlock:^{
                        
                    }];
                }
            }];
        }
    } else if (indexPath.section == 3) {
        if (self.isSellMode) {
            cell.iconName = @"clueOrSell_cus_follow";
            cell.title = self.cusFollowTextArray.lastObject;
            [self.cusFollowTextArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                if (idx < self.cusFollowTextArray.count - 1) {
                    CGFloat width = (kWindowWidth - 20) /3;
                    CGFloat height = ASigletonDataHeight;
                    if (idx == 0) {
                        height *= 2;
                    }
                    ESTVerticalValueView *childView = [ESTVerticalValueView valueViewWithName:obj value:@"0" backgroundColorModel:BackgroundColor_Theme];
                    [menuView addSubview:childView];
                    childView.layer.borderColor = ESTBackgroundColor.CGColor;
                    childView.layer.borderWidth = 0.5;
                    __block NSInteger index = idx;
                    [childView mas_makeConstraints:^(MASConstraintMaker *make) {
                        make.top.equalTo(menuView).offset(idx / 3 * ASigletonDataHeight);
                        make.width.mas_equalTo(width);
                        if (index > 2) {
                            index ++;
                        }
                        make.left.equalTo(menuView).offset(index % 3 * width);
                        make.height.mas_equalTo(height);
                    }];
                    [childView setDidClickCoverBlock:^{
                        
                    }];
                }
            }];
        } else {
            cell.iconName = @"clueOrSell_clue_follow";
            cell.title = self.clueFollowTextArray.lastObject;
            CGFloat width = (kWindowWidth - 20) * 0.5;
            CGFloat height = ASigletonDataHeight;
            ESTVerticalValueView *leftChildView = [ESTVerticalValueView valueViewWithName:self.clueFollowTextArray.firstObject value:@"0" backgroundColorModel:BackgroundColor_Theme];
            [menuView addSubview:leftChildView];
            leftChildView.layer.borderColor = ESTBackgroundColor.CGColor;
            leftChildView.layer.borderWidth = 0.5;
            [leftChildView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.equalTo(menuView);
                make.width.mas_equalTo(width);
                make.left.equalTo(menuView);
                make.height.mas_equalTo(height);
            }];
            [leftChildView setDidClickCoverBlock:^{

            }];
            TYZView *rightView = [[TYZView alloc] init];
            [menuView addSubview:rightView];
            rightView.layer.borderColor = ESTBackgroundColor.CGColor;
            rightView.layer.borderWidth = 0.5;
            [rightView mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.equalTo(menuView);
                make.width.mas_equalTo(width);
                make.right.equalTo(menuView);
                make.height.mas_equalTo(height);
            }];
            ESTVerticalValueView *childView1 = [ESTVerticalValueView valueViewWithName:self.clueFollowTextArray[1] value:@"0" backgroundColorModel:BackgroundColor_Theme];
            [rightView addSubview:childView1];
            [childView1 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.equalTo(rightView);
                make.width.mas_equalTo(width * 0.5);
                make.left.equalTo(rightView);
                make.height.mas_equalTo(height);
            }];
            [childView1 setDidClickCoverBlock:^{

            }];
            ESTVerticalValueView *childView2 = [ESTVerticalValueView valueViewWithName:self.clueFollowTextArray[2] value:@"0" backgroundColorModel:BackgroundColor_Theme];
            [rightView addSubview:childView2];
            [childView2 mas_makeConstraints:^(MASConstraintMaker *make) {
                make.top.equalTo(menuView);
                make.width.mas_equalTo(width * 0.5);
                make.right.equalTo(menuView);
                make.height.mas_equalTo(height);
            }];
            [childView2 setDidClickCoverBlock:^{
                
            }];
        }
    } else if (indexPath.section == 4) {
        cell.iconName = @"clueOrSell_target_icon";
        cell.title = [@"当月目标达成率" S];
        if (self.isSellMode) {
            [self.saleTargetTextArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                if (idx < self.saleTargetTextArray.count - 1) {
                    CGFloat width = (kWindowWidth - 20) / 3;
                    CGFloat height = ASigletonDataHeight;
                    ESTVerticalValueView *childView = [ESTVerticalValueView valueViewWithName:obj value:@"0" backgroundColorModel:BackgroundColor_Theme];
                    [menuView addSubview:childView];
                    childView.layer.borderColor = ESTBackgroundColor.CGColor;
                    childView.layer.borderWidth = 0.5;
                    [childView mas_makeConstraints:^(MASConstraintMaker *make) {
                        make.top.equalTo(menuView).offset(idx / 3 * ASigletonDataHeight);
                        make.width.mas_equalTo(width);
                        make.left.equalTo(menuView).offset(idx % 3 * width);
                        make.height.mas_equalTo(height);
                    }];
                    [childView setDidClickCoverBlock:^{
                        
                    }];
                }
            }];
        } else {
            [self.clueTargetTextArray enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
                if (idx < self.clueTargetTextArray.count - 1) {
                    CGFloat width = (kWindowWidth - 20) / 2;
                    CGFloat height = ASigletonDataHeight;
                    ESTVerticalValueView *childView = [ESTVerticalValueView valueViewWithName:obj value:@"0" backgroundColorModel:BackgroundColor_Theme];
                    [menuView addSubview:childView];
                    childView.layer.borderColor = ESTBackgroundColor.CGColor;
                    childView.layer.borderWidth = 0.5;
                    [childView mas_makeConstraints:^(MASConstraintMaker *make) {
                        make.top.equalTo(menuView).offset(idx / 2 * ASigletonDataHeight);
                        make.width.mas_equalTo(width);
                        make.left.equalTo(menuView).offset(idx % 2 * width);
                        make.height.mas_equalTo(height);
                    }];
                    [childView setDidClickCoverBlock:^{
                        
                    }];
                }
            }];
        }
    }
    return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (BOOL)tableView:(UITableView *)tableView shouldHighlightRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    return NO;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    CGFloat offSetY = scrollView.contentOffset.y;
    self.offSetY = offSetY;
    if (offSetY < 0 && self.offSetY > 0) {
        self.offSetY = offSetY;
    }
    if (offSetY >= 0 && self.offSetY < 0) {
        self.offSetY = offSetY;
    }
}
#pragma mark - setter & getter
- (TYZTableView *)tableView {
    if (_tableView == nil) {
        _tableView = [[TYZTableView alloc] init];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    }
    return _tableView;
}
- (void)setOffSetY:(CGFloat)offSetY {
    _offSetY = offSetY;
    if (offSetY <= 0) {
        self.tableView.backgroundColor = ThemeColor;
    } else {
        self.tableView.backgroundColor = ESTBackgroundColor;
    }
}
- (NSArray<NSString *> *)telSaleTextArray {
    if (_telSaleTextArray == nil) {
        _telSaleTextArray = @[
                              [@"新增线索" S],
                              [@"新增转化" S],
                              [@"新增订单" S],
                              [@"新增成交" S],
                              [@"电销概况" S]];
    }
    return _telSaleTextArray;
}
- (NSArray<NSString *> *)saleTextArray {
    if (_saleTextArray == nil) {
        _saleTextArray = @[
                           [@"新增线索" S],
                           [@"新增意向" S],
                           [@"新增战败" S],
                           [@"新增订单" S],
                           [@"新增交车" S],
                           [@"销售概况" S]
                           ];
    }
    return _saleTextArray;
}
- (NSArray<NSString *> *)clueFollowTextArray {
    if (_clueFollowTextArray == nil) {
        _clueFollowTextArray = @[
                                 [@"线索完成率" S],
                                 [@"去电" S],
                                 [@"邀约" S],
                                 [@"线索跟进" S]
                                 ];
    }
    return _clueFollowTextArray;
}
- (NSArray<NSString *> *)cusFollowTextArray {
    if (_cusFollowTextArray == nil) {
        _cusFollowTextArray = @[
                                [@"任务完成率" S],
                                [@"到店" S],
                                [@"去电" S],
                                [@"来电" S],
                                [@"试驾" S],
                                [@"客户跟进" S]
                                ];
    }
    return _cusFollowTextArray;
}
- (NSArray<NSString *> *)clueTargetTextArray {
    if (_clueTargetTextArray == nil) {
        _clueTargetTextArray = @[
                                 [@"线索邀约" S],
                                 [@"线索到店转换" S],
                                 [@"当月目标达成率" S]
                                 ];
    }
    return _clueTargetTextArray;
}
- (NSArray<NSString *> *)saleTargetTextArray {
    if (_saleTargetTextArray == nil) {
        _saleTargetTextArray = @[
                                 [@"客户留资" S],
                                 [@"客户跟进" S],
                                 [@"客户到店" S],
                                 [@"客户试驾" S],
                                 [@"订单" S],
                                 [@"交车" S],
                                 [@"当月目标达成率" S]
                                 ];
    }
    return _saleTargetTextArray;
}
@end
